package cn.com.connext.scrm.repository.master;

import cn.com.connext.scrm.domain.master.CrmAuthorizerToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CrmAuthorizerTokenRepository extends JpaRepository<CrmAuthorizerToken, String>, JpaSpecificationExecutor {

    /**
     * 查询最新一次记录
     */
    @Query(value = "select authorizer_refresh_token from crm_authorizer_token  order by create_time desc limit 1 ", nativeQuery = true)
    String getLastRefreshToken();
}
